package com.foo.cms.service.impl;

import com.foo.cms.service.BaseService;
import com.foo.cms.service.PartService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: LZS
 * Date: 12-6-24
 * Time: 下午5:04
 * To change this template use File | Settings | File Templates.
 */
@Service
public class PartServiceImpl extends BaseService implements PartService {
    @Override
    public Map<Object,Object> listLeaf() {
        Map<Object,Object> result = new HashMap<Object,Object>();
        String sql = "select * from dt_part where numpartlevel = 2 and vc2enableflag='Y'";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql, new HashMap<String, Object>());
        for(Map<String,Object> map : list){
            result.put(map.get("numpartid"),map.get("vc2partname"));
        }
        return result;  //To change body of implemented methods use File | Settings | File Templates.
    }
}
